#!/bin/bash
# -*-sh-*-

TEST_LOGS=""
MAKEFLAGS=""
status=0

source ./common/TEST_ENV  || exit 1
source ./common/functions || exit 1

cd dev-tools/cilk || exit 1
export BATS_JUNIT_CLASS=Cilk

# bootstrap the local autotools project if necessary

./bootstrap || exit 1

for compiler in $COMPILER_FAMILIES ; do

    if [ "$compiler" != "intel" ]; then
	continue
    fi

    echo " "
    echo " "
    echo "-------------------------------------------------------"
    echo "Dev Tools: CILK tests: $compiler"
    echo "-------------------------------------------------------"

    module purge            || exit 1
    module load $compiler   || exit 1

    ./configure             || exit 1
    make clean >& /dev/null || exit 1
    make -k check           || status=1

    save_logs_compiler_family tests $compiler

    make clean >& /dev/null
done

exit ${status}
